diff --git a/django/urls/conf.py b/django/urls/conf.py
index b3937d5512..df9b13360b 100644
--- a/django/urls/conf.py
+++ b/django/urls/conf.py
@@ -57,6 +57,10 @@ def include(arg, namespace=None):
 def _path(route, view, kwargs=None, name=None, Pattern=None):
     from django.views import View
 
+    # Type check for kwargs
+    if kwargs is not None and not isinstance(kwargs, dict):
+        raise TypeError('kwargs must be a dict.')
+
     if isinstance(view, (list, tuple)):
         # For include(...) processing.
         pattern = Pattern(route, is_endpoint=False)
diff --git a/django/urls/resolvers.py b/django/urls/resolvers.py
index 110ad87cdb..420ebbb04d 100644
--- a/django/urls/resolvers.py
+++ b/django/urls/resolvers.py
@@ -345,6 +345,8 @@ class URLPattern:
         self.pattern = pattern
         self.callback = callback  # the view
         self.default_args = default_args or {}
+        if not isinstance(self.default_args, dict):
+            raise TypeError("URLPattern default_args must be a dict.")
         self.name = name
 
     def __repr__(self):
